﻿using System;
using System.Collections.Generic;

namespace Battle.Engine.InputData
{
    public class InActorData
    {
        public string uniqueId;
        public string heroId;
        public int level;
        public int fpid;
        public int atx;//天命等级
        public double hp;
        public double maxHp;
        public double att;//攻击
        public double patt;//物理攻击
        public double matt;//法术攻击
        public double pdef;//物防
        public double mdef;//法防
        public double hit;//命中率
        public double dodge;//闪避率
        public double cri;//暴击率
        public double antiCri;//抗暴率
        public double criFactor;//暴击系数
        public double cure; //治疗值
        public double heal; //被治疗值
        public double treatAdd; //治疗加成
        public double damageAdd;//伤害加成
        public double damageReduce;//伤害减免
        public double pdamageReduce;//物理伤害减免
        public double mdamageReduce;//法术伤害减免
        public List<InSkillData> skills;
        public List<InTalentData> talents;

        public double firstSkillChance;
        
        public string weaponId;
        public int breachedLevel;

        public InActorData()
        {
        }

        public InActorData(BattleActorData data) {
            this.uniqueId = data.uniqueId;
            this.heroId = data.heroId;
            this.level = data.level;
            this.fpid = data.fpid;
            this.hp = data.hp;
            this.maxHp = data.maxHp;
            this.att = data.att;
            this.patt = 0;
            this.matt = 0;
            this.pdef = data.pdef;
            this.mdef = data.mdef;
            this.hit = data.hit;
            this.dodge = data.dodge;
            this.cri = data.cri;
            this.antiCri = data.antiCri;
            this.criFactor = data.criFactor;
            this.cure = 0;
            this.heal = 0;
            this.treatAdd = 0;
            this.damageAdd = data.damageAdd;
            this.damageReduce = data.damageReduce;
            this.pdamageReduce = 0;
            this.mdamageReduce = 0;
            this.weaponId = data.weaponId;
            this.breachedLevel = data.breachedLevel;

            this.firstSkillChance = data.firstSkillChance;

            this.skills = new List<InSkillData>();
            foreach (var skill in data.skills)
            {
                InSkillData _skill = new InSkillData(skill);
                skills.Add(_skill);
            }

            this.talents = new List<InTalentData>();
            foreach(var talent in data.talents)
            {
                InTalentData _talent = new InTalentData(talent);
                this.talents.Add(_talent);
            }
        }


    }
}
